﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Common.Enums
{
    public static class BusinessErrorCodeExtensions
    {
        public static string GetMessage(this BusinessErrorCode errorCode)
        {
            return errorCode switch
            {
                BusinessErrorCode.ACCOUNT_DISABLED_ERROR => "该账号已被禁用",
                BusinessErrorCode.ACCOUNT_ERROR => "账号或密码错误",
                BusinessErrorCode.ACCOUNT_NOT_NULL => "账号或密码为空",
                BusinessErrorCode.PASSWORD_NOT_NULL => "密码不能为空",
                BusinessErrorCode.PHONE_NOT_NULL => "手机号不能为空",
                BusinessErrorCode.NICKNAME_NOT_NULL => "昵称不能为空",
                BusinessErrorCode.ACCOUNT_EXISTS => "账号已存在",
                BusinessErrorCode.PHONE_EXISTS => "手机号已存在",
                BusinessErrorCode.REGISTRATION_FAILED => "注册失败，请稍后重试",
                BusinessErrorCode.VERIFICATION_CODE_NOT_NULL => "验证码为空",
                BusinessErrorCode.INVALID_VERIFICATION_CODE => "验证码无效或已过期",
                BusinessErrorCode.INVALID_REQUEST => "请求参数错误",
                BusinessErrorCode.ACCOUNT_NOT_EXISTS => "账号不存在",
                BusinessErrorCode.ACCESS_DENIED => "无访问权限",
                BusinessErrorCode.ROLE_USER_BOUND => "该角色已绑定用户，删除失败",
                BusinessErrorCode.INTERNAL_SERVER_ERROR => "服务器内部错误",
                _ => "未知错误"
            };
        }
    }
}
